﻿<UserControl x:Class="PenguinPublishNS.Views.WebFilesList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:c="clr-namespace:PenguinPublishNS"
             xmlns:models="clr-namespace:PenguinPublishNS.Models"
             xmlns:vm="clr-namespace:PenguinPublishNS.ViewModel"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600" Unloaded="UserControl_Unloaded">
    <!--<UserControl.Resources>
        <c:WebFile x:Key="NameListData"/>
    </UserControl.Resources>-->
    <Grid d:DataContext="{d:DesignInstance Type=models:HostServer}" Margin="0,0,0,198">
        <StackPanel Height="38" Margin="10,1,10,0" VerticalAlignment="Top" Orientation="Horizontal">
            <Image HorizontalAlignment="Left" Height="34" Margin="10,0,0,0" Width="37" Source="/PenguinPublish;component/Images/sftp_32x32.png" Stretch="None" VerticalAlignment="Top"/>
            <Label x:Name="titleLabel" Content="Select a host for preview and publish" HorizontalAlignment="Left" Height="27" Margin="10,0,0,0" VerticalAlignment="Top" Width="228" FontWeight="Bold"/>
            <ComboBox x:Name="cboHostNames" SelectedValuePath="hostId" DisplayMemberPath="hostName" SelectedIndex="0" HorizontalAlignment="Left" Height="24" VerticalAlignment="Top" Width="157" ItemsSource="{Binding hostName}" SelectionChanged="cboHostNames_SelectionChanged" Margin="10,0,0,0" Loaded="cboHostNames_Loaded"/>
            <Button x:Name="btnClear" Content="Clear Snapshot" Height="24" VerticalAlignment="Top" Width="95" Margin="20,0,0,0" Click="btnClear_Click" ToolTip="Start Over! Delete snapshot and Publish from scratch"/>
        </StackPanel>
        <StackPanel Height="18" Margin="66,33,24,0" VerticalAlignment="Top" Orientation="Horizontal">
            <CheckBox x:Name="chkValidIP" Content="Ping Success" Height="18" VerticalAlignment="Top" Width="97" Margin="10,0,0,0" IsChecked="{Binding ipAvailable}" IsEnabled="False"/>
            <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Last Published" VerticalAlignment="Top" Margin="40,0,0,0"/>
            <TextBlock x:Name="txtLastPublished" HorizontalAlignment="Left" Height="19" Margin="10,0,0,-1" TextWrapping="Wrap" Text="{Binding lastPublished}" VerticalAlignment="Top" Width="131" IsEnabled="False"/>
            <TextBlock x:Name="txtSnapHashWarn" Height="20" Margin="20,0,0,-2" TextWrapping="Wrap" Text="Snapshot Mismatch!" VerticalAlignment="Top" Width="134" ToolTip="We detected that the host server hash does not match the snapshot of local website" Foreground="#FFCF0F0F" FontWeight="Bold" TextAlignment="Center" HorizontalAlignment="Left"/>
        </StackPanel>
        <StackPanel x:Name="panelButtons" HorizontalAlignment="Left" Height="30" Margin="0,68,0,0" VerticalAlignment="Top" Width="195" Orientation="Horizontal">
            <Button x:Name="btnPreview" Content="Preview" HorizontalAlignment="Left" Height="26" VerticalAlignment="Top" Width="86" Click="btnPreview_Click" ToolTip="Does the actual compare of website to snapshot" IsEnabled="False" Margin="0"/>
            <Button x:Name="btnPublish" Content="Publish" HorizontalAlignment="Left" Height="26" VerticalAlignment="Top" Width="86" Click="btnPublish_Click" ToolTip="Currently just creates the first snapshot" IsEnabled="False" Margin="20,0,0,0"/>
        </StackPanel>
         <DataGrid d:DataContext="{d:DesignInstance Type=vm:WebFileViewmodel}" x:Name="fileGrid" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,132,0,-230" ItemsSource="{Binding Mode=OneWay}" AutoGenerateColumns="False" Height="300" Width="590" AlternatingRowBackground="#FFEAD3D3" GridLinesVisibility="None">
            <DataGrid.Columns>
                <DataGridCheckBoxColumn Binding="{Binding uploaded}" ClipboardContentBinding="{x:Null}"/>
                <DataGridTextColumn Binding="{Binding filepath}" ClipboardContentBinding="{x:Null}"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>



</UserControl>
